#region "DatabaseEventArgs"

/*
 * ####     Developer Name : Wang Yucai
 * 
 * ####     Development Tool : Microsoft VisualStudio 2010 Ultimate Edition
 * 
 * ####     Create Time : 2014-07-15 10:53:30
 * 
 * ####     Namespace : Masterduner.SourceStudio.Practices.DevelopmentLibrary.Data
 * 
 * ####     Type Name : DatabaseEventArgs
 * 
 * ####     Full Name : Masterduner.SourceStudio.Practices.DevelopmentLibrary.Data.DatabaseEventArgs
 * 
 * ####     Machine Name : GLCHQWYCWINW7
 * 
 * ####     UserName : GUOCOLAND/wangyucai
 * 
 * ####     CLR Version : 4.0.30319.18444
 * 
 * ####     Target Framework Version : 4.0
 */

#endregion

using System;

namespace Masterduner.SourceStudio.Practices.DevelopmentLibrary.Data
{
    /// <summary>
    /// <para>Masterduner.SourceStudio.Practices.DevelopmentLibrary.Data.DatabaseEventArgs</para>
    /// <para>
    /// 数据库事件参数。
    /// </para>
    /// </summary>
    /// <remarks>
    /// <para>Target Framework Version : 4.0</para>
    /// </remarks>
    [Serializable]
    public class DatabaseEventArgs : EventArgs
    {
        private bool _successful;
        private object _dataResult;
        private DatabaseExceptionWrapper _error;
        private Type _dataResultType;

        #region Successful
        /// <summary>
        /// 获取数据库命令是否执行成功。
        /// </summary>
        public virtual bool Successful
        {
            get { return _successful; }
            protected set { _successful = value; }
        }
        #endregion

        #region DataResult
        /// <summary>
        /// 获取数据结果。
        /// </summary>
        public virtual object DataResult
        {
            get { return _dataResult; }
            protected set { _dataResult = value; }
        }
        #endregion

        #region Error
        /// <summary>
        /// 获取当Successful等于false时的数据库异常。
        /// </summary>
        public virtual DatabaseExceptionWrapper Error
        {
            get { return _error; }
            protected set { _error = value; }
        }
        #endregion

        #region DataResultType
        /// <summary>
        /// 获取数据结果的类型。
        /// </summary>
        public virtual Type DataResultType
        {
            get { return _dataResultType; }
            protected set { _dataResultType = value; }
        }
        #endregion

        #region Constructor

        /// <summary>
        /// <para>构造函数：</para>
        /// <para>初始化一个<see cref="DatabaseEventArgs" />对象实例。</para>
        /// </summary>
        /// <param name="successful">数据库命令是否执行成功。</param>
        /// <param name="dataResult">数据结果。</param>
        /// <param name="resultType">数据结果的<see cref="Type"/>。</param>
        /// <param name="error">数据库异常。</param>
        public DatabaseEventArgs(bool successful, object dataResult, Type resultType, DatabaseExceptionWrapper error)
        {
            this.Successful = successful;
            this.DataResult = dataResult;
            this.DataResultType = resultType;
            this.Error = error;
        }

        #endregion
    }
}

#region README

/*
 * ####     ©2014 Wang Yucai
 * 
 * ####     Contact me
 *                  
 *                  E-mail : Masterduner@Yeah.net
 *                  Mobile : 13621384677
 *                  QQ : 180261899
 */

#endregion